Installing GDB

Contents|Index|Previous|Next
Installing GDB

GDB comes with a configure script that automates the process of preparing GDB for installation; you can then use make to build the gdb program.

The GDB distribution includes all the source code you need for GDB in a single directory, whose name is usually composed by appending the version number to gdb.

That directory contains the following.

- configure (and supporting files)
Script for configuring GDB and all its supporting libraries
- gdb
The source specific to GDB itself
- bfd
Source for the Binary File Descriptor library
- include
GNU include files
- libiberty
Source for the -liberty free software library
- opcodes
Source for the library of opcode tables and disassemblers
- readline
Source for the GNU command-line interface
- glob
Source for the GNU filename pattern-matching subroutine
- mmalloc
Source for the GNU memory-mapped malloc package

The simplest way to configure and build GDB is to run configure from the source directory.

Pass the identifier for the platform on which GDB will run as an argument.

Change to the directory in which GDB resides. Then, use the following command.

./configure host
make

host is an identifier such as sun4 or decstation, that identifies the platform where GDB will run. (You can often leave off host; configure tries to guess the correct value by examining your system.)

Running configure host and then running make builds the bfd, readline, mmalloc, and libiberty libraries, then gdb itself. The configured source files, and the binaries, are left in the corresponding source directories.

configure is a Bourne-shell (/bin/sh) script; if your system does not recognize this automatically when you run a different shell, you may need to run sh on it explicitly:

sh configure host

If you run configure from a directory that contains source directories for multiple libraries or programs, configure creates configuration files for every directory level underneath (unless you tell it not to, with the --norecursion option). You can run the configure script from any of the subordinate directories if you only want to configure from one of those subdirectories, but be sure to specify a path to it. You can install gdb anywhere; it has no hardwired paths. However, you should make sure that the shell on your path (named by the SHELL environment variable) is publicly readable. Remember that GDB uses the shell to start your programsome systems refuse to let GDB debug child processes whose programs are not readable.

Top|Contents|Index|Previous|Next